QLibrary: fix deadlock caused by fix to QTBUG-39642
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Fri, 26 Jun 2020 16:47:18 +0000 (17:47 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Fri, 26 Jun 2020 16:47:18 +0000 (17:47 +0100)
commitdc767cae255daba05d83826885cdbffc23d38745
tree8d493ef4fcdec97e8eae01462f0f28234bf62daf
parent65a495b8e6aa1cf6fe18c8ff41d857c5621806a5
QLibrary: fix deadlock caused by fix to QTBUG-39642

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=276fa8383a753576
Last-Update: 2020-04-17

Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around
the entire load_sys(). We had reasoned that deadlocks would only occur if
the object creation in instance() recursed into its own instance(),
which was already a bug. But we had forgotten that dlopen()/
LoadLibrary() executes initialization code from the module being loaded,
which could cause a recursion back into the same QPluginLoader or
QLibrary object. This recursion is benign because the module *is* loaded
and dlopen()/LoadLibrary() returns the same handle.

Gbp-Pq: Name fix_qlibrary_deadlock.diff
src/corelib/plugin/qlibrary.cpp
src/corelib/plugin/qlibrary_unix.cpp
src/corelib/plugin/qlibrary_win.cpp